<template>
    <div>
        马云的年龄<input type="number" v-model="mayun">
        <hr>
        马化腾的年龄<input type="number" v-model="huateng">
        <hr>
        总的年龄<input type="number" v-model="sum">
    </div>


</template>
<script>
import {computed,reactive,toRefs} from 'vue'
export default({
    setup(){
        const mayun = ''
        const huateng = ''
        const res = reactive({mayun,huateng})
        const sum = computed(()=>{
            return res.mayun + res.huateng
        })

        return{...toRefs(res),sum}

    }
})
</script>
<style>
</style>